const SCHEME_HTTP = 'http';
const SCHEME_HTTPS = 'https';
const SCHEME_WS = 'ws';
const SCHEME_WSS = 'wss';

class MyUrl {
  final String? scheme;
  final String host;
  final int? port;
  final int? tlsPort;
  final String? path;

  MyUrl({
    this.scheme,
    required this.host,
    this.port,
    this.tlsPort,
    this.path,
  });

  String get httpUrl {
    return "$SCHEME_HTTP://$host${port != null ? ":$port" : ""}${path != null ? "/$path" : ""}";
  }

  String get httpsUrl {
    return "$SCHEME_HTTPS://$host${tlsPort != null ? ":$tlsPort" : ""}${path != null ? "/$path" : ""}";
  }
}
